<template>
    <div>
    <el-table
      :data="tableData"
      style="width: 100%;margin-bottom: 20px;"
      row-key="id"
      border
      :tree-props="{children: 'children'}"
    >
      <el-table-column prop="uid" label="用户编号" sortable width="180"></el-table-column>
      <el-table-column prop="nickname" label="昵称"  width="180"></el-table-column>
      <el-table-column prop="phone" label="手机号"  width="180"></el-table-column>
      <el-table-column  label="状态"  width="180">
          <template v-slot="scope">
              <el-button v-if="scope.row.status === 1" type="success">启用</el-button>
              <el-button v-else type="danger">禁用</el-button>
          </template>
      </el-table-column>
      <el-table-column  label="操作" sortable width="180">
          <template v-slot="scope">
            <el-button type="success" @click="edit(scope.row.uid)">编辑</el-button>
          </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { mapActions, mapGetters } from 'vuex'
export default {
 methods:{
        ...mapActions({
            requestMember:"member/memberActions"
        }),
        edit(uid){
          this.$emit('edit',uid)
        }
    },
    computed:{
        ...mapGetters({
            tableData:"member/tableData"
        })
    },
    mounted(){
        this.requestMember()
    }
}
</script>

<style>

</style>